﻿@{;
ViewBag.Title = "表单页面";
Layout = "~/Views/Shared/_Form.cshtml";
}
<link href="~/Content/scripts/plugins/jqgrid/jqgrid.css" rel="stylesheet" />
<script src="~/Content/scripts/plugins/jqgrid/grid.locale-cn.js"></script>
<script src="~/Content/scripts/plugins/jqgrid/jqgrid.min.js"></script>
<script>
    var keyValue = request('keyValue');
    $(function () {
        initControl();
    });
    //初始化控件
    function initControl() {
        //获取表单
        if (!!keyValue) {
            $.SetForm({
                url: "../../CustomerManage/MAProduct/GetFormJson",
                param: { keyValue: keyValue },
                success: function (data) {
                    $("#form1").SetWebControls(data);
                }
            })
        }
    }
    //保存表单;
    function AcceptClick() {
        if (!$('#form1').Validform()) {
            return false;
        }
        var postData = $("#form1").GetWebControls(keyValue);
        $.SaveForm({
            url: "../../CustomerManage/MAProduct/SaveForm?keyValue=" + keyValue,
            param: postData,
            loading: "正在保存数据...",
            success: function () {
                $.currentIframe().$("#gridTable").trigger("reloadGrid");
            }
        })
    }
    function initControl() {
        //目标
        $("#Type").ComboBox({
            description: "==请选择==",
            height: "200px"
        });
    }
</script>
<div style="margin-top: 20px; margin-right: 30px;">
    <table class="form">
        <tr>
            <td class="formTitle">会员编号</td>
            <td class="formValue">
                <input id="CustomerId" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">产品编号</td>
            <td class="formValue">
                <input id="ProductId" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">产品标题</td>
            <td class="formValue">
                <input id="ProductTitle" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">产品价格</td>
            <td class="formValue">
                <input id="ProductPrice" type="text" class="form-control" isvalid="yes" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">产品链接</td>
            <td class="formValue">
                <input id="ImageUrl" type="text" class="form-control" isvalid="yes" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">产品类型</td>
            <td class="formValue">
                <div id="Type" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
                    <ul>
                        <li data-value="1">降价</li>
                        <li data-value="2">上架</li>
                    </ul>
                </div>
            </td>>
        </tr>
    </table>
</div>
